package com.news.base;

import android.app.Application;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.news.di.component.AppComponent;
import com.news.di.component.DaggerAppComponent;
import com.news.di.module.AppModule;

/**
 * Created by Administrator on 2017/3/1 0001.
 */

public class BaseApp extends Application {

    private AppComponent appComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        appComponent = DaggerAppComponent
                .builder()
                .appModule(getAppModule())
                .build();
        Fresco.initialize(this);
    }

    public AppComponent getAppComponent(){
        return appComponent;
    }

    private AppModule getAppModule() {
        return new AppModule(this);
    }
}
